const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    port: 8080, //前端服务启动的端口号
    host: 'localhost', //前端服务启动后的访问ip，默认为localhost, host和port组成了前端服务启动后的访问入口。
    https: false,
    open: true,
    proxy: {
      '/test': {
        target: 'http://localhost:8081/test',
        changeOrigin: true
      },
      '/register': {
        target: 'http://localhost:8081/register',
        changeOrigin: true,
        pathRewrite: {
          '^/register': '',
        }
      },
      '/login': {
        target: 'http://localhost:8081/login',
        changeOrigin: true,
        pathRewrite: {
          '^/login': '',
        },
      },
      '/add_friend': {
        target: 'http://localhost:8081/add_friend',
        changeOrigin: true,
        pathRewrite: {
          '^/add_friend': '',
        },
      },

    }
  }
})
